package com.shundr.shipper.common.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.shundr.shipper.R;

public class DialogDelete extends Dialog {

	private TextView ivDelete;
	private TextView ivCancel;
	private Context context;
	private onDeleteListener onDeleteListener;

	public DialogDelete(Context context) {
		super(context, R.style.dialog_style);
		this.context = context;
	}

	public onDeleteListener getOnDeleteListener() {
		return onDeleteListener;
	}

	public void setOnDeleteListener(onDeleteListener onDeleteListener) {
		this.onDeleteListener = onDeleteListener;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.view_dialog_delete);
		setCanceledOnTouchOutside(true);
		ivDelete = (TextView) findViewById(R.id.tv_delete_favorite);
		ivCancel = (TextView) findViewById(R.id.tv_cancel);
		setCanceledOnTouchOutside(false);
		ivDelete.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				onDeleteListener.delete();
				dismiss();
			}
		});
		ivCancel.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});
	}
	
	public interface onDeleteListener{
		public void delete();
	}
}
